CREATE VIEW dvipv_bodyweight_open 
AS 
  SELECT file_no, 
         lact, 
         abs_adjustment, 
         pct_adjustment, 
         mim1, 
         mim2, 
         mim3, 
         mim4, 
         mim5, 
         mim6, 
         mim7, 
         mim8, 
         mim9, 
         mim10, 
         mim11, 
         mim12, 
         mim13, 
         mim14, 
         mim15, 
         mim16, 
         mim17, 
         mim18, 
         mim19, 
         mim20, 
         mim21, 
         mim22, 
         mim23, 
         mim24 
  FROM   dbo.dvip_in_bodyweight_open 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         lact, 
         abs_adjustment, 
         pct_adjustment, 
         mim1, 
         mim2, 
         mim3, 
         mim4, 
         mim5, 
         mim6, 
         mim7, 
         mim8, 
         mim9, 
         mim10, 
         mim11, 
         mim12, 
         mim13, 
         mim14, 
         mim15, 
         mim16, 
         mim17, 
         mim18, 
         mim19, 
         mim20, 
         mim21, 
         mim22, 
         mim23, 
         mim24 
  FROM   dbo.dvip_def_bodyweight_open; 

go 

CREATE VIEW dvipv_cull_risk_lact 
AS 
  SELECT file_no, 
         lact1, 
         lact2, 
         lact3, 
         lact4, 
         lact5, 
         lact6, 
         lact7, 
         lact8, 
         lact9, 
         lact10, 
         lact11, 
         lact12 
  FROM   dbo.dvip_in_cull_risk_lact 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         lact1, 
         lact2, 
         lact3, 
         lact4, 
         lact5, 
         lact6, 
         lact7, 
         lact8, 
         lact9, 
         lact10, 
         lact11, 
         lact12 
  FROM   dbo.dvip_def_cull_risk_lact; 

go 

CREATE VIEW dvipv_cull_risk_mim 
AS 
  SELECT file_no, 
         mim1, 
         mim2, 
         mim3, 
         mim4, 
         mim5, 
         mim6, 
         mim7, 
         mim8, 
         mim9, 
         mim10, 
         mim11, 
         mim12, 
         mim13, 
         mim14, 
         mim15, 
         mim16, 
         mim17, 
         mim18, 
         mim19, 
         mim20, 
         mim21, 
         mim22, 
         mim23, 
         mim24 
  FROM   dbo.dvip_in_cull_risk_mim 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         mim1, 
         mim2, 
         mim3, 
         mim4, 
         mim5, 
         mim6, 
         mim7, 
         mim8, 
         mim9, 
         mim10, 
         mim11, 
         mim12, 
         mim13, 
         mim14, 
         mim15, 
         mim16, 
         mim17, 
         mim18, 
         mim19, 
         mim20, 
         mim21, 
         mim22, 
         mim23, 
         mim24 
  FROM   dbo.dvip_def_cull_risk_mim; 

go 

CREATE VIEW dvipv_cull_seasonality 
AS 
  SELECT file_no, 
         abs_adjustment, 
         pct_adjustment, 
         seasonality, 
         jan, 
         feb, 
         mar, 
         apr, 
         may, 
         jun, 
         jul, 
         aug, 
         sep, 
         oct, 
         nov, 
         dec 
  FROM   dbo.dvip_in_cull_seasonality 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         abs_adjustment, 
         pct_adjustment, 
         seasonality, 
         jan, 
         feb, 
         mar, 
         apr, 
         may, 
         jun, 
         jul, 
         aug, 
         sep, 
         oct, 
         nov, 
         dec 
  FROM   dbo.dvip_def_cull_seasonality; 

go 

CREATE VIEW dvipv_milk_seasonality 
AS 
  SELECT file_no, 
         lact, 
         abs_adjustment, 
         pct_adjustment, 
         seasonality, 
         jan, 
         feb, 
         mar, 
         apr, 
         may, 
         jun, 
         jul, 
         aug, 
         sep, 
         oct, 
         nov, 
         dec 
  FROM   dbo.dvip_in_milk_seasonality 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         lact, 
         abs_adjustment, 
         pct_adjustment, 
         seasonality, 
         jan, 
         feb, 
         mar, 
         apr, 
         may, 
         jun, 
         jul, 
         aug, 
         sep, 
         oct, 
         nov, 
         dec 
  FROM   dbo.dvip_def_milk_seasonality; 

go 

CREATE VIEW dvipv_milk_wood_curve 
AS 
  SELECT file_no, 
         lact1a, 
         lact1b, 
         lact1c, 
         lact2a, 
         lact2b, 
         lact2c, 
         lact3a, 
         lact3b, 
         lact3c 
  FROM   dbo.dvip_in_milk_wood_curve 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         lact1a, 
         lact1b, 
         lact1c, 
         lact2a, 
         lact2b, 
         lact2c, 
         lact3a, 
         lact3b, 
         lact3c 
  FROM   dbo.dvip_def_milk_wood_curve; 

go 

CREATE VIEW dvipv_misc 
AS 
  SELECT file_no, 
         unit, 
         analysis, 
         write_pol, 
         write_rpo, 
         start_sea, 
         policy, 
         max_mim, 
         cull_milk, 
         cull_margin, 
         interest, 
         p_loss, 
         inv_cull_pct, 
         funk, 
         p_calf, 
         p_fixed_labor, 
         p_fixed_other, 
         p_other_dry, 
         p_other_lact, 
         p_tmr_dm_dry, 
         p_tmr_dm_lac, 
         dmi_dry, 
         pct_fat, 
         pa_cv, 
         milk_repeat, 
         p_labor, 
         time_fresh, 
         time_lact, 
         time_dry, 
         vet_cost_1, 
         vet_cost_2, 
         vet_cost_3, 
         vet_cost_4 
  FROM   dbo.dvip_in_misc 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         unit, 
         analysis, 
         write_pol, 
         write_rpo, 
         start_sea, 
         policy, 
         max_mim, 
         cull_milk, 
         cull_margin, 
         interest, 
         p_loss, 
         inv_cull_pct, 
         funk, 
         p_calf, 
         p_fixed_labor, 
         p_fixed_other, 
         p_other_dry, 
         p_other_lact, 
         p_tmr_dm_dry, 
         p_tmr_dm_lac, 
         dmi_dry, 
         pct_fat, 
         pa_cv, 
         milk_repeat, 
         p_labor, 
         time_fresh, 
         time_lact, 
         time_dry, 
         vet_cost_1, 
         vet_cost_2, 
         vet_cost_3, 
         vet_cost_4 
  FROM   dbo.dvip_def_misc; 

go 

CREATE VIEW dvipv_price 
AS 
  SELECT file_no, 
         year, 
         month, 
         breed_cows, 
         enter_heifer, 
         heifer_price, 
         cull_price, 
         milk_price 
  FROM   dbo.dvip_in_price 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         year, 
         month, 
         breed_cows, 
         enter_heifer, 
         heifer_price, 
         cull_price, 
         milk_price 
  FROM   dbo.dvip_def_price; 

go 

CREATE VIEW dvipv_repro_abort_risk_mpreg 
AS 
  SELECT file_no, 
         preg_month2, 
         preg_month3, 
         preg_month4, 
         preg_month5, 
         preg_month6, 
         preg_month7, 
         preg_month8 
  FROM   dbo.dvip_in_repro_abort_risk_mpreg 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         preg_month2, 
         preg_month3, 
         preg_month4, 
         preg_month5, 
         preg_month6, 
         preg_month7, 
         preg_month8 
  FROM   dbo.dvip_def_repro_abort_risk_mpreg; 

go 

CREATE VIEW dvipv_repro_conc_pct_mim 
AS 
  SELECT file_no, 
         mim3, 
         mim4, 
         mim5, 
         mim6, 
         mim7, 
         mim8, 
         mim9, 
         mim10, 
         mim11, 
         mim12, 
         mim13, 
         mim14, 
         mim15, 
         mim16 
  FROM   dbo.dvip_in_repro_conc_pct_mim 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         mim3, 
         mim4, 
         mim5, 
         mim6, 
         mim7, 
         mim8, 
         mim9, 
         mim10, 
         mim11, 
         mim12, 
         mim13, 
         mim14, 
         mim15, 
         mim16 
  FROM   dbo.dvip_def_repro_conc_pct_mim; 

go 

CREATE VIEW dvipv_repro_conc_risk_lact 
AS 
  SELECT file_no, 
         lact1, 
         lact2, 
         lact3, 
         lact4, 
         lact5, 
         lact6, 
         lact7, 
         lact8, 
         lact9, 
         lact10, 
         lact11, 
         lact12 
  FROM   dbo.dvip_in_repro_conc_risk_lact 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         lact1, 
         lact2, 
         lact3, 
         lact4, 
         lact5, 
         lact6, 
         lact7, 
         lact8, 
         lact9, 
         lact10, 
         lact11, 
         lact12 
  FROM   dbo.dvip_def_repro_conc_risk_lact; 

go 

CREATE VIEW dvipv_repro_conc_seasonality 
AS 
  SELECT file_no, 
         abs_adjustment, 
         seasonality, 
         jan, 
         feb, 
         mar, 
         apr, 
         may, 
         jun, 
         jul, 
         aug, 
         sep, 
         oct, 
         nov, 
         dec 
  FROM   dbo.dvip_in_repro_conc_seasonality 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         abs_adjustment, 
         seasonality, 
         jan, 
         feb, 
         mar, 
         apr, 
         may, 
         jun, 
         jul, 
         aug, 
         sep, 
         oct, 
         nov, 
         dec 
  FROM   dbo.dvip_def_repro_conc_seasonality; 

go 

CREATE VIEW dvipv_repro_heat_pct_mim 
AS 
  SELECT file_no, 
         mim3, 
         mim4, 
         mim5, 
         mim6, 
         mim7, 
         mim8, 
         mim9, 
         mim10, 
         mim11, 
         mim12, 
         mim13, 
         mim14, 
         mim15, 
         mim16 
  FROM   dbo.dvip_in_repro_heat_pct_mim 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         mim3, 
         mim4, 
         mim5, 
         mim6, 
         mim7, 
         mim8, 
         mim9, 
         mim10, 
         mim11, 
         mim12, 
         mim13, 
         mim14, 
         mim15, 
         mim16 
  FROM   dbo.dvip_def_repro_heat_pct_mim; 

go 

CREATE VIEW dvipv_repro_heat_seasonality 
AS 
  SELECT file_no, 
         abs_adjustment, 
         seasonality, 
         jan, 
         feb, 
         mar, 
         apr, 
         may, 
         jun, 
         jul, 
         aug, 
         sep, 
         oct, 
         nov, 
         dec 
  FROM   dbo.dvip_in_repro_heat_seasonality 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         abs_adjustment, 
         seasonality, 
         jan, 
         feb, 
         mar, 
         apr, 
         may, 
         jun, 
         jul, 
         aug, 
         sep, 
         oct, 
         nov, 
         dec 
  FROM   dbo.dvip_def_repro_heat_seasonality; 

go 

CREATE VIEW dvipv_repro_misc 
AS 
  SELECT file_no, 
         vwp_1, 
         vwp_2, 
         vwp_3, 
         lbm, 
         timebreeding, 
         p_semen, 
         maxlact 
  FROM   dbo.dvip_in_repro_misc 
  UNION 
  SELECT (SELECT file_no 
          FROM   dbo.dvip_sys_default_file) AS File_No, 
         vwp_1, 
         vwp_2, 
         vwp_3, 
         lbm, 
         timebreeding, 
         p_semen, 
         maxlact 
  FROM   dbo.dvip_def_repro_misc; 

go 